package com.spring.test.aop.chain;

import java.util.Arrays;
import java.util.List;

public class Main {
    static class ChainHandlerA extends BaseHandler {
        @Override
        protected void handlerProcess() {
            System.out.println("切面 a");
        }
    }

    static class ChainHandlerB extends BaseHandler{
        @Override
        protected void handlerProcess() {
            System.out.println("切面 b");
        }
    }

    static class ChainHandlerC extends BaseHandler{
        @Override
        protected void handlerProcess() {
            System.out.println("切面 c");
        }
    }

    public static void main(String[] args) {

        List<BaseHandler> handlerList = Arrays.asList(
                new ChainHandlerA(),
                new ChainHandlerB(),
                new ChainHandlerC()
        );

        Chain chain = new Chain(handlerList);
        chain.proceed();

    }
}
